home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shs_lantern.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  85 lines

  1. # Jones 3D Cog Script
  2. #
  3. # shs_lantern.cog
  4. #    An alternative to gen_torchlight if hardcoded values are preferable.
  5. #    Indy reach animation plays dependent on value of reach. Flame is present but invisible at startup 
  6. #    Best use: Rename for target level and adjust hardcoded values as required. 
  7. #
  8. # [SXC] [RKD]
  9. #
  10. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  11. #
  12. # ========================================================================================
  13.  
  14. symbols
  15.  
  16. message     activated
  17. message     startup
  18. message     timer
  19.  
  20. thing       torch                    //the thing you light
  21. thing       flame        nolink        //flame, hidden at startup
  22. thing        player        local
  23.  
  24. sound       burning=gen_torch_burnin_c.wav  local
  25.  
  26. vector      minlite        local
  27. vector      maxlite        local
  28.  
  29. flex        minradius=0.25    local
  30. flex        maxradius=0.4    local
  31. flex        reach=0            //0 for medium, 1 for high
  32. flex        islit=0            //set to 1 if torch lights at startup
  33.  
  34. #SUB-ROUTINES
  35.  
  36. flex        lightit            local
  37.  
  38.  
  39. end
  40.  
  41. # ========================================================================================
  42.  
  43. code
  44.  
  45. startup:
  46.     player = GetLocalPlayerThing();
  47.     minlite = VectorSet(0.87, 0.60, 0.06);
  48.     maxlite = VectorSet(0.89, 0.64, 0.30);    
  49.     SetThingFlags(flame, 0x10);
  50.     SetThingLight(torch, VectorSet(0.0, 0.0, 0.0), 0.3, 0.01);
  51.  
  52.     if (islit) call lightit;    
  53.     return;
  54.  
  55. # ........................................................................................
  56. activated:
  57.     if (islit) return;
  58.     if ((GetCurWeapon(player) != 13) && (!InEditor())) return;
  59.     Print("let there be light");
  60.     PlayMode(player, (60 + reach), 0);
  61.     Sleep(0.5);        //no return, falls through to lightit
  62.  
  63. # ........................................................................................
  64.  
  65. lightit:
  66.     ClearThingFlags(flame, 0x10);
  67.     SetThingLight(flame, minlite, 0.2, 0.5);                           
  68.     SetThingLight(torch, '0.2, 0.2, 0.2', 0.01, 0.5);     
  69.     Sleep(0.5);
  70.  
  71.     PlaySoundThing(burning, torch, 1, 3, 10, 1);
  72.     islit = 1;
  73.     
  74.     return;
  75.         
  76. end
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.